package fmse.uaic.k.configuration_abstraction.visitors;

import java.util.ArrayList;
import java.util.List;

import fmse.uaic.k.configuration_abstraction.abstract_classes.KAbstractNode;
import fmse.uaic.k.configuration_abstraction.abstract_visitor.KAbstractNodeVisitor;

public class SearchByLabelVisitor extends KAbstractNodeVisitor {

	private String label;
	private List<KAbstractNode> nodes;

	public SearchByLabelVisitor() {
		super();
		nodes = new ArrayList<KAbstractNode>();
	}

	@Override
	public void visit(KAbstractNode abstractNode) {
		if (abstractNode.getLabel().equals(label))
			nodes.add(abstractNode);
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public List<KAbstractNode> getNodes() {
		return nodes;
	}

	public void setNodes(ArrayList<KAbstractNode> nodes) {
		this.nodes = nodes;
	}

}
